import React from 'react';
import { useStores } from '../utils/store';
import Recommend from './Recommend';

// status 0主播已经下播  1正在直播 2主播封禁 3有数据但是无法播放,
const StatusRecommend = ({ sportId, status: propStatus, roomId, title, offLineTime, userImage, leagueName }) => {
  const { status } = useStores();

  if (propStatus !== 1 || status.destroy) {
    // 如果没有正在直播或者播放器已经销毁就显示推荐
    return (
      <Recommend
        sportId={sportId}
        roomId={roomId}
        title={title}
        offLineTime={offLineTime}
        userImage={userImage}
        leagueName={leagueName}
      />
    );
  }

  return null;
};

export default StatusRecommend;
